var sqlMap = {
    projectSql: {
        addLiveInfo: 'INSERT INTO todaycast.broadcasts (className, classNameID, childClassName, childClassNameID, hostName, hosthead, labelName, liveLink, imgBase, liveContent, liveSource, liveStartTime, liveEndTime, OPID, OPName, isShow, hits, isPriority, priority, isBanner) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',

        updateLiveInfo: 'update todaycast.broadcasts set className=?, classNameID=?, childClassName=?, childClassNameID=?, hostName=?, hosthead=?, labelName=?, liveLink=?, imgBase=?, liveContent=?, liveSource=?, liveStartTime=?, liveEndTime=?, OPID=?, OPName=?, isShow=?, isPriority=?, priority=?, isBanner=?  where id=?',
        deleteLiveInfo: 'delete from todaycast.broadcasts where id = ?',

        getDataList: "select * from todaycast.broadcasts",
        getNavigationList: 'select *, 0 isLiveing from todaycast.broadcasts',
        getCount: 'select count(1) as total from todaycast.broadcasts',

        getBanner: " select * from todaycast.broadcasts where isBanner=1 and isShow=1 order by priority asc,hits desc,createTime desc limit 0,5;",

        recordHits: 'update todaycast.broadcasts set hits=hits+1 where id=?;',
        visitSource: 'insert into todaycast.visitsource(broadcastID,labelName,ip,nationality,area,deviceVersion,msg) values(?,?,?,?,?,?,?);',

        getCategory: "SELECT * FROM todaycast.category ",
        getLiveSource: "SELECT * FROM todaycast.liveSource order by id asc",
        getLiveLabel: "SELECT * FROM todaycast.liveLabel order by id asc",

        addCategoryInfo: "insert into todaycast.category(className,pathName,OPID,OPName,classNameID,orderNum) values(?,?,?,?,?,?);",
        addLiveSource: "insert into todaycast.livesource(sourceName,OPID,OPName) values(?,?,?);",
        addLiveLabel: "INSERT INTO todaycast.livelabel (labelName, OPID, OPName) VALUES (?,?,?);",

        editCategoryInfo: "update todaycast.category set className=?,pathName=?,OPID=?,OPName=?,classNameID=?,orderNum=? where id=?",
        editLiveSource: "update todaycast.livesource set sourceName=? where id=?",
        editLiveLabel: "update todaycast.livelabel set labelName=? where id=?",

        deleteCategoryInfo: "delete from todaycast.category where id=?",
        deleteLiveSource: "delete from todaycast.livesource where id=?",
        deleteLiveLabel: "delete from todaycast.livelabel where id=?",
        //获取直播操作日期
        addBroadcastlog: " INSERT INTO todaycast.broadcastlog( broadcastID, logs, status, OPID, OPName) VALUES (?,?,?,?,?);",
        getBroadcastlog: "SELECT * FROM todaycast.broadcastlog where broadcastID=? order by createTime desc;",

        getUserInfo: "SELECT * FROM todaycast.userinfo where status=1 and  userName=? and password=?",

        /*累计总用户ip访问量*/
        getVisitsTotal: "select count(*) as visitTotal from todaycast.visitsource where nationality is not null;select count( distinct ip) as ipNum from todaycast.visitsource where nationality is not null;",

        /*日活跃用户*/
        getVisitsDay: "select  date_format(visitTime,'%Y-%m-%d') as date,labelName, (COUNT(distinct ip)) AS num from todaycast.visitsource ",

        /*今日标签访问量*/
        getVisitDayLabel: "select labelName,count(*) visitNum from todaycast.visitsource where nationality is not null and YEARWEEK(date_format(visitTime,'%Y-%m-%d')) = YEARWEEK(now()) group by labelName;",
        getVisitsWeekLabel: "select * from todaycast.visitsource where nationality is not null and YEARWEEK(date_format(visitTime,'%Y-%m-%d')) = YEARWEEK(now()) group by labelName;",

        /*月活跃用户*/
        getVisitsMonth: "select * from todaycast.visitsource where nationality is not null and DATE_FORMAT( visitTime, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) group by ip;",
        getVisitsMonthLabel: "select * from todaycast.visitsource where nationality is not null and DATE_FORMAT( visitTime, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) group by labelName;",

        // 新闻
        // 获取新闻列表
        getNewsList: "select * from news",
        getNewsCount: 'select count(1) as total from todaycast.news',
        // 获取新闻详情
        getNewsDetails: "select * from news where id=?",

        // 新增新闻
        addNews: "insert into news(maintitle,subtitle,maintext) values(?,?,?)",
        // 修改新闻
        updateNews: "update news set maintitle=?,subtitle=?,maintext=? where id = ?",
        // 删除新闻
        deleteNews: "delete from news where id=?"

    }
}
module.exports = sqlMap;

